﻿<%@ Page Language="vb" EnableSessionState="True" AutoEventWireup="false" CodeBehind="Uploadfy.aspx.vb" Inherits="ProjetoDeTestes.Uploadfy" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="uploadify.css" rel="stylesheet" type="text/css" />
    <script src="jquery-1.4.2.min.js" type="text/javascript"></script>
    <script src="jquery.uploadify.v2.1.4.min.js" type="text/javascript"></script>
    <script src="swfobject.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#fileUpload").uploadify({
                'uploader': 'uploadify.swf',
                'script': 'Handler.ashx',
                'cancelImg': 'cancel.png',
                'folder': 'uploads',
                'multi': 'true',
                'buttonText': 'Selecionar',
                'width': 200,
                'onAllComplete': function (event, data) {pegaEventoArquivosEnviados(); }
            });
        });
        function pegaEventoArquivosEnviados() {
            $.ajax({
                type: "POST",
                url: "Uploadfy.aspx/mostraData",
                data: "{}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (msg) {
                    $('#divHora').text(msg.d);
                    $('#Button1').click();
                }
            });
            return false;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div id="divUpload">O_o
                <br />
                <input id="fileUpload" type="file" runat="server" clientidmode="Static" /><br />
                <a href="javascript:$('#fileUpload').uploadifyUpload();">Enviar</a>
                <br />
                O_o </div><br />
                <div id="#divHora">
                    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <div id="divHora">
        <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
    </div>
    <asp:Button ID="Button1" runat="server" Text="Button" style="display:none" />
    </form>
</body>
</html>
